
import pygame, math, sys, random

class Background(pygame.sprite.Sprite):
    def __init__(self, position, screenSize):
        pygame.sprite.Sprite.__init__(self, self.containers)
        self.image = pygame.image.load("rsc/background/bg.png")
        self.rect = self.image.get_rect()
        self.realx = position[0]
        self.realy = position[1]
        self.xOffset = 0
        self.yOffset = 0
        self.place(position)
        self.scrollingx = False
        self.scrollingy = False
     
    def place(self, position):
        self.rect.center = position
        #print "I've moved to", position
        
    def move(self):
        self.place([self.realx-self.xOffset, self.realy-self.yOffset])
    
    def update(*args):
        self = args[0]
        self.xOffset = args[1]
        self.yOffset = args[2]
        self.scrollingx = args[3]
        self.scrollingy = args[4]
        self.move()
